package com.hmall.api.item.fallbackfactory;

import com.hmall.api.item.UserClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author: lxr
 * @Date: 2025/09/03 19:46
 * @Description:
 */
public class UserClientFallbackFactory implements FallbackFactory<UserClient> {
    private static final Logger log = LoggerFactory.getLogger(UserClientFallbackFactory.class);

    @Override
    public UserClient create(Throwable cause) {
        return new UserClient() {
            @Override
            public void deductMoney(String pw, Integer amount) {
                log.error("{}", cause.getMessage());
            }
        };
    }
}
